
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.2</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="css/font.css">
    <link rel="stylesheet" href="css/xadmin.css">
    <link rel="stylesheet" href="css/admin.css">
    <script src="lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .procu_show_p{
            height: 38px;
            line-height: 38px;
            font-weight: bold;
        }
        .procu_show_p_long{
            font-weight: bold;
        }
    </style>
</head>
<body>
    <form action="" >
        <input name="supply_name" type="hidden" value="${supply_name}">
        <p style="margin: 18px">供应商现在的类别：${supply_category}</p>
        <p style="margin: 18px">调整类别为：<select name="category" id="CLASS" name="CLASS">
        <option value="临时供应商">临时供应商</option>
        <option value="一般供应商">一般供应商</option>
        <option value="内部供应商">内部供应商</option>
        <option value="重点供应商">重点供应商</option>
    </select>
        </p>
        <div class="layui-row" style="margin-top: 100px;margin-left: 70px;">
            <div class="pro_form_div" style="margin: 0 auto;width: 150px;padding-bottom: 40px;">
                <a class="layui-btn" title="确定"  onclick="changecategory('${supply_name}')" href="javascript:;">确定
                </a>
            </div>
        </div>
    </form>
</body>
<script>
    function changecategory(name) {
        layer.confirm('确认要提交吗？', function (index) {
            var CLASS = $("#CLASS").val();
            $.ajax({
                type: "post",
                dataType: "json",
                url: "/changecategory",
                data:{"supply_name":name,"category":CLASS},
                success: function (data) {
                    if (data > 0) {
                        alert('提交成功,已更改该供应商类型');
                        /*window.location.href = "to_supplyexaminelist";*/
                        setTimeout(function () {
                            parent.window.location.reload();
                        },1000);
                    } else {
                        alert('提交失败');
                        window.location.reload();
                    }
                }
            });

        });
    }
</script>
</html>
